<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri ="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<div class="page-header">
	<h3>访问路径列表</h3>
</div>
<table class="table table-striped table-hover .table-condensed">
	<thead>
		<tr>
			<th>url</th>
			<th>访问IP</th>
			<th>会话Id</th>
			<th>会话时间</th>
			<th>是否有效</th>
		</tr>
	</thead>
	<tbody id="data"></tbody>
</table>
<div id="layPage" class="text-center"></div>





<script type="text/javascript">
	var pageNum = 1;
	var basePath = $("#basePath").val();
	
	$(function(){
		goPage(1);
	})
	
	function goPage(pageNum){
		$.post(basePath+"/accessLog/doList",{pageNum:pageNum} ,function(qr){
			var html = '';
			if(!qr||qr.success==false){
				html += '获取数据失败'	;
			
			}else{
				var data = qr.page.list;
				for(var i = 0; i<data.length;i++){
					html+='<tr>'
					+'<td>'+(data[i].url||"")+'</td>'
					+'<td>'+(data[i].accessIp||"")+'</td>'
					+'<td>'+(data[i].sessionId||"")+'</td>'
					+'<td>'+(data[i].accessTime||"")+'</td>'
					+'<td>'+(data[i].flag==0?"false":"true")+'</td>'
					+'</tr>';
				}
			}
			$("#data").empty();
			paging(qr.page);
			$("#data").append(html);
		});
	}
	
 	function paging(page){
		laypage({
		    cont: 'layPage',
		    pages: page.pageCount,
		    curr: page.pageNum,
		    jump: function(obj,first){
		    	if(!first){
		    		goPage(obj.curr);
		    	}
		    }
		});
	} 

</script>


